﻿using MediaImporter.Controls;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace MediaImporter.Controllers
{
   public class SubfolderController
    {
        public event EventHandler ImportPressed;

        ITextSettingControl control;

        public SubfolderController(ITextSettingControl control, DateTime date)
        {
            this.control = control; 
            SubfolderName = string.Format("{0}-{1}-{2}-", date.Year, date.Month.ToString("00"), date.Day.ToString("00"));
            control.ActionPressed += control_ActionPressed;
        }

       
        void control_ActionPressed(object sender, EventArgs e)
        {
            if (ImportPressed != null)
                ImportPressed(this, EventArgs.Empty);
        }

        public string SubfolderName
        {
            get
            {
                return control.Value;
            }
            set
            {
                control.Value = value;
            }
        }
    }
}
